<?php
/*
 * @Package Softpin Order Manager
 * @Subpackage : sim Manager
 * Create by : thuc.lehuy@gmail.com
 */
defined('_JEXEC') or die('Restricted access');
?>
<form action="index.php" method="post" name="adminForm">
    <table>
        <tr>
            <td align="left" width="100%">
                <?php echo JText::_('Lọc theo số sim'); ?>:
                <input type="text" name="search" id="search" value="<?php echo htmlspecialchars($this->lists['search']); ?>" class="text_area" onchange="document.adminForm.submit();" />
                <button onclick="this.form.submit();"><?php echo JText::_('Go'); ?></button>
                <button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_('Reset'); ?></button>
                <b style="color:red;">Số sim tìm thấy: <?php echo $this->total; ?> sim </b>
            </td>
            <td nowrap="nowrap">
                <?php
                echo $this->lists['type_admin'];
                echo $this->lists['type_provider'];
                echo $this->lists['type'];
                echo $this->lists['state'];
                ?>
            </td>
        </tr>
    </table>
    <table class="adminlist">
        <thead>
            <tr>
                <th width="5">
                    <?php echo JText::_('stt'); ?>
                </th>
                <th width="20">
                    <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->items); ?>);" />
                </th>
                <th class="title">
                    <?php echo JHTML::_('grid.sort', 'Số sim', 'p.sim_numb', @$this->lists['order_Dir'], @$this->lists['order']); ?>
                </th>
				<!--
                <th class="title">
                    <?php //echo JHTML::_('grid.sort', 'Kho admin', 'admin_name', @$this->lists['order_Dir'], @$this->lists['order']); ?>
                </th>-->
                <th class="title">
                    <?php echo JHTML::_('grid.sort', 'Nhà cung cấp', 'provider_name', @$this->lists['order_Dir'], @$this->lists['order']); ?>
                </th>
                <th class="title">
                    <?php echo JHTML::_('grid.sort', 'Loại Sim', 'categori_name', @$this->lists['order_Dir'], @$this->lists['order']); ?>
                </th>
                <th class="title">
                    <?php echo JHTML::_('grid.sort', 'Giá', 'p.price', @$this->lists['order_Dir'], @$this->lists['order']); ?>
                </th>
                <th class="title">
                    <?php echo JHTML::_('grid.sort', 'Ngày tạo', 'p.created_at', @$this->lists['order_Dir'], @$this->lists['order']); ?>
                </th>
                <th class="title">
                    <?php echo JHTML::_('grid.sort', 'Trạng thái', 'p.del_flag', @$this->lists['order_Dir'], @$this->lists['order']); ?>
                </th>
                <th class="title">
                    <?php echo JHTML::_('grid.sort', 'ID', 'p.sim_id', @$this->lists['order_Dir'], @$this->lists['order']); ?>
                </th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <td colspan="12">
                    <?php echo $this->pagination->getListFooter(); ?>
                </td>
            </tr>
        </tfoot>
        <?php
                    $k = 0;
                    for ($i = 0, $n = count($this->items); $i < $n; $i++) {
                        $row = & $this->items[$i];
                        $checked = JHTML::_('grid.id', $i, $row->sim_id);
                        $link = JRoute::_('index.php?option=com_sim&controller=sim&task=edit&cid[]=' . $row->sim_id);
        ?>
                <tr class="<?php echo "row$k"; ?>">
                    <td>
                        <?php echo $i+ $this->pagination->limitstart; ?>
                    </td>
                    <td>
                <?php echo $checked; ?>
                    </td>
                    <td>
                        <a href="<?php echo $link; ?>"><?php echo $row->sim_numb; ?></a>
                    </td>
					<!--
                    <td>					
                <?php //echo $row->admin_name; ?>
                    </td>-->
                    <td>
                <?php echo $row->provider_name; ?>
                    </td>
                    <td>
                <?php echo $row->categori_name; ?>
                    </td>
                    <td>
                <?php echo JUtility::thousandseperate($row->price); ?>.000
                    </td>
                    <td>
                    <?php echo $row->created_at; ?>
                    </td>
                    <td>
                <?php
                        if ($row->del_flag) {
                            echo("Đã bán");
                        } else {
                            echo("Đang có");
                        }
                ?>
                    </td>
                    <td>
                <?php echo $row->sim_id; ?>
                    </td>
                </tr>
                <?php
                        $k = 1 - $k;
                    }
                ?>
                </table>
                <input type="hidden" name="option" value="com_sim" />
                <input type="hidden" name="task" value="" />
                <input type="hidden" name="boxchecked" value="0" />
                <input type="hidden" name="controller" value="sim" />

                <input type="hidden" name="filter_client" value="<?php echo $this->client; ?>" />
                <input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
                <input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
    <?php echo JHTML::_('form.token'); ?>
</form>
